<!DOCTYPE html>
<html lang="en">

  <head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>复习继承</title>
  </head>

  <body>

  </body>
  <script>
    class Person {
      constructor(name, age, gender) {
        this.name = name,
          this.age = age,
          this.gender = gender
      }
      sayHi() {
        console.log("你好，我是" + this.name);
      }
    }

    Person.prototype.xyz = 100;



    class Student extends Person {
      // constructor(name, age, gender) {
      //   this.name = name,
      //     this.age = age,
      //     this.gender = gender
      // }
      sayHi() {
        console.log("你好，我是" + this.name);
      }
    }
    Student.prototype.abc = 10;



    const p = new Person("人", 20, "男");
    const s = new Student("学生", 18, '女')
  </script>

</html>